//
//  CPMView.m
//  JZRJAPPT
//
//  Created by mac on 16/5/11.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "CPMView.h"

@interface CPMView ()
@property (nonatomic, strong)UIView *CpmView;

@property (nonatomic, strong) UILabel *textLable;

@end
@implementation CPMView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.CpmView = [[UIView alloc]initWithFrame:CGRectMake(0, 0 ,SCREEN_WIDTH -200, 30)];
        self.textLable = [[UILabel alloc]initWithFrame:CGRectMake(0, 0 ,SCREEN_WIDTH-200, 30)];
        self.textLable .text = @"网络异常,请检查后再试" ;
        self.textLable.textColor =[UIColor whiteColor];
        self.CpmView.backgroundColor = [UIColor blackColor];
        self.textLable.textAlignment = NSTextAlignmentCenter;
        [self.CpmView addSubview:self.textLable];
        [self addSubview:_CpmView];
        // 渐变消失的动画
        [UIView animateWithDuration:5 animations:^{
            self.CpmView.alpha = 0.f;
        }];

    }
    return self;
}

@end
